#include <stdio.h>
 
int main()
{
    int list[4] = {1,2,3,4};
    int one,two,three;
    for (int i=0;i<4;i++) {
        one = list[i];
        for (int j=0;j<4;j++) {
            if (one != list[j]) {
                two = list[j];
                for (int k=0;k<4;k++) {
                    if (two != list[k] && one != list[k]) {
                        three = list[k];
                        printf("%d%d%d \n",one,two,three);
                    }
                }
            }
            
        }
    }
    return 0;
}